3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
A model's interpolation style determines the method of interpolation a renderer uses when applying lighting or other shading effects to a surface. QuickDraw 3D defines constants for the interpolation styles that are currently available.
typedef enum TQ3InterpolationStyle {
kQ3InterpolationStyleNone,
kQ3InterpolationStyleVertex,
kQ3InterpolationStylePixel
} TQ3InterpolationStyle;
The constant kQ3InterpolationStyleNone specifies that no interpolation is to occur. When a renderer applies an effect (such as illumination) to a surface, it calculates a single intensity value for an entire polygon. This style results in a model's surfaces having a faceted appearance.
To render surfaces smoothly, you can specify one of two interpolation styles. The constant kQ3InterpolationStyleVertex specifies that the renderer is to interpolate values linearly across a polygon, using the values at the vertices. The constant kQ3InterpolationStylePixel specifies that the renderer is to apply an effect at every pixel in the image. For example, a renderer will calculate illumination based on the surface normal of every pixel in the image. This rendering style is likely to be computation-intensive.
Previous | QD3D Book | Overview | Chapter Contents | Next |